//
//  FKDownloadManager.h
//  FK
//
//  Created by handy wang on 6/8/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FKDownloadTask.h"
#import "ASIHTTPRequest.h"

@protocol FKDownloadManagerDelegate

@optional
- (void)noTasksToDownload;

- (void)requestFailed:(ASIHTTPRequest *)request withDownloadTask:(FKDownloadTask *)downloadintTaskParam;

- (void)requestFinished:(ASIHTTPRequest *)request withDownloadTask:(FKDownloadTask *)downloadintTaskParam;

- (void)didFinishAllTasksDownload;

@end

@interface FKDownloadManager : NSObject {
    NSMutableArray *_delegates;
    NSMutableArray *_downloadingTasks;
    ASIHTTPRequest *_downloadingRequest;
}

@property(nonatomic, retain, readonly)NSMutableArray *downloadingTasks;
@property(nonatomic, retain, readonly)ASIHTTPRequest *downloadingRequest;

+ (FKDownloadManager *)sharedInstance;

- (void)startDownload;

- (void)addDelegate:(id)delegateParam;

- (void)addANewTask:(FKDownloadTask *)aNewTask;

@end